

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/IKKIS_LOGO.png">
  <link rel="icon" href="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/IKKIS_LOGO.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Ikki">
  <meta name="keywords" content="">
  
    <meta name="description" content="IEEE二进制浮点数算术标准（IEEE 754）是20世纪80年代以来最广泛使用的浮点数运算标准，为许多CPU与浮点运算器所采用。">
<meta property="og:type" content="article">
<meta property="og:title" content="IEEE754标准">
<meta property="og:url" content="http://81.68.132.127/2022/10/20/JS/binary/IEEE754%E6%A0%87%E5%87%86/index.html">
<meta property="og:site_name" content="IKKI">
<meta property="og:description" content="IEEE二进制浮点数算术标准（IEEE 754）是20世纪80年代以来最广泛使用的浮点数运算标准，为许多CPU与浮点运算器所采用。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/beijing/iTab-571998.png">
<meta property="article:published_time" content="2022-10-19T23:24:35.000Z">
<meta property="article:modified_time" content="2022-10-19T23:28:11.037Z">
<meta property="article:author" content="Ikki">
<meta property="article:tag" content="前端基础">
<meta property="article:tag" content="js">
<meta property="article:tag" content="进制转换">
<meta property="article:tag" content="IEEE754">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/beijing/iTab-571998.png">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>IEEE754标准 - IKKI</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  



  
<link rel="stylesheet" href="/fluid/css/fluid-extention.css">
<link rel="stylesheet" href="/fluid/css/nihao.css">



  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"81.68.132.127","root":"/","version":"1.9.3","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":3},"lazyload":{"enable":true,"loading_img":"https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 100vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Ikki-BUG制造者</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('http://image.ikki0603.cn') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="IEEE754标准"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-10-20 07:24" pubdate>
          2022年10月20日 早上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.4k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          20 分钟
        
      </span>
    

    
    
      
        <span id="busuanzi_container_page_pv" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="busuanzi_value_page_pv"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
        <div class="scroll-down-bar">
          <i class="iconfont icon-arrowdown"></i>
        </div>
      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">IEEE754标准</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：2022年10月20日 早上
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <p><a target="_blank" rel="noopener" href="http://zhufengpeixun.com/strong/html/104.1.binary.html">链接</a><br><a target="_blank" rel="noopener" href="https://juejin.cn/post/6844904093601759239">浮点数计算</a></p>
<h1 id="1-IEEE754标准"><a href="#1-IEEE754标准" class="headerlink" title="1.IEEE754标准"></a>1.IEEE754标准</h1><ul>
<li>JavaScript采用的是双精度(64位)</li>
<li><a target="_blank" rel="noopener" href="http://www.binaryconvert.com/convert_double.html">双精度浮点数内存中编码</a></li>
<li>符号位决定了一个数的正负,指数部分决定了数值的大小,尾数部分决定了数值的精度</li>
</ul>
<p>(3.5)<del>10</del> =(11.1)<del>2</del>=1.11×2^1^<br>(7.5)<del>10</del>=(111.1)<del>2</del>=1.111x2^10^<br>(10.5)<del>10</del> = (1010.1)<del>2</del> = 1.0101x2^11^</p>
<h2 id="1-1-单精度-32位-浮点数的结构"><a href="#1-1-单精度-32位-浮点数的结构" class="headerlink" title="1.1 单精度(32位)浮点数的结构"></a>1.1 单精度(32位)浮点数的结构</h2><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/Hotchpotch/JS/basic/binary/ikki-2022-04-09-11-35-02.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload></p>
<ul>
<li>其中的指数部分（E）采用的偏置码（biased）的形式来表示正负指数，若E&lt;127则为负的指数，否则为非负的指数。</li>
<li>求值方法: (-1)^符号位^ x(1.尾数部分) x 2^(指数部分-127)^</li>
</ul>
<h2 id="1-2-双精度-64位-浮点数的结构"><a href="#1-2-双精度-64位-浮点数的结构" class="headerlink" title="1.2 双精度(64位)浮点数的结构"></a>1.2 双精度(64位)浮点数的结构</h2><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/Hotchpotch/JS/basic/binary/ikki-2022-04-09-11-36-27.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload></p>
<ul>
<li>双精度的指数部分（E）采用的偏置码为1023</li>
<li>求值方法: (-1)^符号位^ x (1.尾数部分) x 2^(指数部分-1023)^</li>
</ul>
<h2 id="1-3-举例分析"><a href="#1-3-举例分析" class="headerlink" title="1.3 举例分析"></a>1.3 举例分析</h2><p>单精度 a=7.5, 双精度a1=7.5 结果解释：<br>(7.5)<del>10</del>=(111.1)<del>2</del>=1.111 x 2^10^;</p>
<ul>
<li>以单精度在内存中存储：<ul>
<li>S=0;(符号位)</li>
<li>E=(2+127)<del>10</del>=10000001; (指数部分)</li>
<li>M=111;(尾数部分)<br><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/Hotchpotch/JS/basic/binary/ikki-2022-04-09-11-39-50.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload></li>
</ul>
</li>
<li>以双精度在内存中存储：<ul>
<li>S=0;(符号位)</li>
<li>E=(2+1023)<del>10</del>=10000000001; (指数部分)</li>
<li>M=111;(尾数部分)<br><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/Hotchpotch/JS/basic/binary/ikki-2022-04-09-11-40-59.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload></li>
</ul>
</li>
</ul>
<h1 id="2-0-1-0-2-0-3"><a href="#2-0-1-0-2-0-3" class="headerlink" title="2.  0.1+0.2 != 0.3"></a>2.  0.1+0.2 != 0.3</h1><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/Hotchpotch/JS/basic/binary/ikki-2022-04-09-11-44-52.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload></p>
<blockquote>
<p>(0.1)<del>10</del> = (0.0001100110011…)<del>2</del> = 1.100110011(0011) x 2^-4^<br>那么，尾数1.100110011(0011)，阶码为 -4，实际存储为 -4+1023 = 1019 的二进制 1111111011</p>
</blockquote>
<blockquote>
<p>0  01111111011  1001100110011001100110011001100110011001100110011010<br>S    E指数             M尾数</p>
</blockquote>
<blockquote>
<p>(0.2)<del>10</del> = (0.001100110011)<del>2</del> = 1.100110011(0011) x 2^-3^<br>那么，尾数1.100110011(0011)，阶码为 -3，实际存储为 -3+1023 = 1020 的二进制 1111111100</p>
</blockquote>
<blockquote>
<p>0  01111111100  1001100110011001100110011001100110011001100110011010<br>S    E指数             M尾数</p>
</blockquote>
<ul>
<li>浮点数进行计算时，需要对阶。即把两个数的阶码设置为一样的值，然后再计算尾数部分。</li>
<li>对阶时需要小阶对大阶。因为，这样相当于，小阶指数乘以倍数，尾数部分相对应的除以倍数，在二进制中即右移倍数位。这样，不会影响到尾数的高位，只会移出低位，损失相对较少的精度(可以理解为小数点向左移动1位)。<figure class="highlight dns"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-zdrpnolacl5vpi"></i><span>dns</span><div class="collapse show" id="collapse-zdrpnolacl5vpi"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs dns">因此，<span class="hljs-number">0</span>.<span class="hljs-number">1</span>的阶码为 -<span class="hljs-number">4</span> , 需要对阶为 <span class="hljs-number">0</span>.<span class="hljs-number">2</span>的阶码 -<span class="hljs-number">3</span> 。尾数部分整体右移一位。<br>原来的<span class="hljs-number">0</span>.<span class="hljs-number">1</span><br><span class="hljs-number">0</span>  <span class="hljs-number">01111111011</span>  <span class="hljs-number">1001100110011001100110011001100110011001100110011010</span><br>对阶后的<span class="hljs-number">0</span>.<span class="hljs-number">1</span><br><span class="hljs-number">0</span>  <span class="hljs-number">01111111100</span>  <span class="hljs-number">1100110011001100110011001100110011001100110011001101</span><br></code></pre></td></tr></table></div></figure></li>
<li>然后进行尾数部分相加<figure class="highlight asciidoc"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-hvzn9xlacl5vpi"></i><span>asciidoc</span><div class="collapse show" id="collapse-hvzn9xlacl5vpi"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs asciidoc"><span class="hljs-code">   0.1100110011001100110011001100110011001100110011001101</span><br>+  1.1001100110011001100110011001100110011001100110011010<br><span class="hljs-section">= 10.0110011001100110011001100110011001100110011001100111* 2^-3</span><br></code></pre></td></tr></table></div></figure></li>
<li>由此可得：<figure class="highlight parser3"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-k3jjtxlacl5vpi"></i><span>parser3</span><div class="collapse show" id="collapse-k3jjtxlacl5vpi"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs parser3"><span class="hljs-number">0.1</span><span class="language-xml"> + </span><span class="hljs-number">0.2</span><span class="language-xml"> = </span><span class="hljs-number">10.0110011001100110011001100110011001100110011001100111</span><span class="language-xml">* </span><span class="hljs-number">2</span><span class="hljs-keyword">^-3</span><span class="language-xml"></span><br><span class="language-xml">根据尾数求和的结果，进行规格化处理，即尾数向右移</span><span class="hljs-number">1</span><span class="language-xml">位，阶码加</span><span class="hljs-number">1</span><span class="language-xml">。</span><br><span class="language-xml"></span><span class="hljs-number">1.00110011001100110011001100110011001100110011001100111</span><span class="language-xml">* </span><span class="hljs-number">2</span><span class="hljs-keyword">^-2</span><span class="language-xml"></span><br><span class="language-xml">尾数只能存储</span><span class="hljs-number">52</span><span class="language-xml">位，最后的“</span><span class="hljs-number">1</span><span class="language-xml">”需要舍去，根据进</span><span class="hljs-number">1</span><span class="language-xml">舍</span><span class="hljs-number">0</span><span class="language-xml">的原则进行操作可得：</span><br><span class="language-xml"></span><span class="hljs-number">1.0011001100110011001100110011001100110011001100110100</span><span class="language-xml">* </span><span class="hljs-number">2</span><span class="hljs-keyword">^-2</span><span class="language-xml"></span><br><span class="language-xml">最后接可以得到</span><br><span class="language-xml"></span><span class="hljs-number">0</span><span class="language-xml"> </span><span class="hljs-number">01111111101</span><span class="language-xml"> </span><span class="hljs-number">0011001100110011001100110011001100110011001100110100</span><span class="language-xml"></span><br><span class="language-xml">二进制也就是</span><br><span class="language-xml"></span><span class="hljs-number">0.010011001100110011001100110011001100110011001100110100</span><span class="language-xml"></span><br><span class="language-xml">十进制就是</span><br><span class="language-xml"></span><span class="hljs-number">0.30000000000000004</span><br></code></pre></td></tr></table></div></figure>
<h1 id="3-0-2-0-2-0-4"><a href="#3-0-2-0-2-0-4" class="headerlink" title="3. 0.2+0.2 =0.4"></a>3. 0.2+0.2 =0.4</h1><figure class="highlight asciidoc"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-a83v0mlacl5vpi"></i><span>asciidoc</span><div class="collapse show" id="collapse-a83v0mlacl5vpi"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs asciidoc">0  01111111100  1001100110011001100110011001100110011001100110011010<br>尾数相加<br><span class="hljs-code">   1001100110011001100110011001100110011001100110011010</span><br>+  1001100110011001100110011001100110011001100110011010<br><span class="hljs-section">= 10011001100110011001100110011001100110011001100110100</span><br>尾数只能存储52位，最后的“1”需要舍去，根据进1舍0的原则进行操作可得：<br>0 01111111100 10011001100110011001100110011001100110011001100110101<br>1.10011001100110011001100110011001100110011001100110101*2^-2<br>二进制也就是<br>0.0110011001100110011001100110011001100110011001100110101<br>十进制就是<br>0.4<br></code></pre></td></tr></table></div></figure></li>
</ul>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/" class="category-chain-item">前端基础</a>
  
  
    <span>></span>
    
  <a href="/categories/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/JS/" class="category-chain-item">JS</a>
  
  
    <span>></span>
    
  <a href="/categories/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/JS/%E8%BF%9B%E5%88%B6%E8%BD%AC%E6%8D%A2/" class="category-chain-item">进制转换</a>
  
  

  

  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/">#前端基础</a>
      
        <a href="/tags/js/">#js</a>
      
        <a href="/tags/%E8%BF%9B%E5%88%B6%E8%BD%AC%E6%8D%A2/">#进制转换</a>
      
        <a href="/tags/IEEE754/">#IEEE754</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>IEEE754标准</div>
      <div>http://81.68.132.127/2022/10/20/JS/binary/IEEE754标准/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Ikki</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年10月20日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2022年10月20日</div>
        </div>
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/10/20/JS/binary/%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AF%B9%E8%B1%A1/" title="二进制对象">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">二进制对象</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/10/20/JS/binary/%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%9F%BA%E7%A1%80/" title="进制转换">
                        <span class="hidden-mobile">进制转换</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  <article id="comments" lazyload>
    
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"6KzYWc2oaEBaHgNl4UIicMJC-gzGzoHsz","appKey":"vJ4FIwKeHRmHraCJraAsjyZ7","path":"window.location.pathname","placeholder":"请输入你的评论\n昵称为必填项目(输入QQ号码可以自动获取昵称和邮箱)\n虽然email不是必选，但是填写了email可以收到推送通知哦！","avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":true,"recordIP":true,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":true},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


  </article>


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
      IKKI-专业BUG开发
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="busuanzi_container_site_pv" style="display: none">
        总访问量 
        <span id="busuanzi_value_site_pv"></span>
         次
      </span>
    
    
      <span id="busuanzi_container_site_uv" style="display: none">
        总访客数 
        <span id="busuanzi_value_site_uv"></span>
         人
      </span>
    
    
  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  
<script src="/fluid/js/star.js"></script>



<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
